<?php
  
  require_once $_SERVER['DOCUMENT_ROOT'].'/tools/config.php';
  $name=stringValue($_POST['name'],'');
  $is_show_nav=stringValue($_POST['is_show_nav'],'');
  $module=stringValue($_POST['module'],'');
  $file_name=stringValue($_POST['file_name'],'');
  $id=stringValue($_POST['id'],0);
  $action=stringValue($_POST['action'],'add');
  
  if($action=='add'){
	   try {
	  	    $sqlTool=new sqlTool();
	  		$upsql=" insert into ae_menu(id,name,is_show_nav,module,file_name)values(null,'$name','$is_show_nav','$module','$file_name')";
	  	  $sqlTool->operate($upsql);
	  }catch (Exception $e){
	  	echo $e;
	  }
  }elseif ($action=='modify'){
      try {
	  	    $sqlTool=new sqlTool();
	  	   
	  		$upsql=" update  ae_menu  set name='$name',is_show_nav=$is_show_nav,module=$module,file_name='$file_name' where id=$id";
	  		 echo $upsql;
	  		  $sqlTool->operate($upsql);
	  }catch (Exception $e){
	  	echo $e;
	  }
  }
 
  
  

  
  
  
   

?>